'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.resources('home', '/api/v1/home', controller.home);
  router.resources('/api/v1/classsort', controller.classsort);
  router.resources('/api/v1/lecture', controller.lecture);
  router.resources('u', '/api/v1/u/', app.jwt, controller.u);
  router.resources('order', '/api/v1/order', app.jwt, controller.pay);
  router.resources('lectureR', '/api/v1/lectureR', app.jwt, controller.lectureR);
  router.resources('cart', '/api/v1/cart', app.jwt, controller.lectureRcart);
  router.resources('setinfo', '/api/v1/setinfo', app.jwt, controller.setinfo);
  router.post('/api/v1/login', controller.userAccess.login);
  router.post('/api/v1/register', controller.register.reg);
  router.post('/ajax', controller.ajax.upload); //本地上传图片测试用
};
